package com.guessgame.view;

import javax.swing.*;

/**
 * @program: guessing game
 * @author: Jiuly
 * @date: 2022/4/26 10:07
 * @Description
 */
public class GuessGameWindow {
    public static void main(String[] args) {
        //1.创建顶层容器
        JFrame guessWindow = new JFrame("石头剪刀布");   //窗口名称
        guessWindow.setSize(800, 500);         //窗口大小
        guessWindow.setLocationRelativeTo(null);
        guessWindow.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);//关闭窗口
        //2.创建中间容器
        JMenuBar menuBar = new JMenuBar();  //菜单栏
        JPanel panel = new JPanel();
        //3.创建组件
        JButton but01 = new JButton("石头");
        JButton but02 = new JButton("剪刀");
        JButton but03 = new JButton("布");
        panel.add(but01);
        panel.add(but02);
        panel.add(but03);
        //4.将中间容器添加到顶层容器
        guessWindow.setContentPane(panel);
        //5.将窗口显示在屏幕
        guessWindow.setVisible(true);
    }
}